Class NewsSourcesRepositoryTest

java.lang.Object
com.fsf.news.repository.NewsSourcesRepositoryTest

@ExtendWith(GuiceExtension.class) @ExtendWith(org.mockito.junit.jupiter.MockitoExtension.class) class NewsSourcesRepositoryTest extends Object
Unit tests for the NewsSourcesRepository class.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) com.fasterxml.jackson.databind.ObjectMapper
     
    (package private) com.fsf.news.repository.NewsSourcesRepository
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    Tests that the findAll method returns the expected sources results when available.
    (package private) void
    Tests that the findAllSources method returns the expected sources when available.
    (package private) void
    Tests that the findAllSources method returns an empty list when searching for sources in a different session.
    (package private) void
    Tests that the findAll method returns the expected sources results when the maximum capacity is exceeded.
    (package private) void
    Tests that the findAll method returns an empty list when searching for sources results in a different session.
    (package private) void
    Tests that the findAll method returns an empty list when no sources results are available.
    (package private) void
    Tests that the findAll method returns the expected sources results when the maximum capacity is reached.
    (package private) void
    Tests that the findAllSources method returns an empty list when no sources are available.
    (package private) void
    Tests that the save method adds a sources result and returns the expected sources result.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • objectMapper

      @Inject @Named("objectMapperJSON") com.fasterxml.jackson.databind.ObjectMapper objectMapper
    • repository

      @InjectMocks com.fsf.news.repository.NewsSourcesRepository repository
  • Constructor Details

    • NewsSourcesRepositoryTest

      NewsSourcesRepositoryTest()
  • Method Details

    • testFindAllEmpty

      @Test void testFindAllEmpty()
      Tests that the findAll method returns an empty list when no sources results are available.
    • testFindAll

      @Test void testFindAll()
      Tests that the findAll method returns the expected sources results when available.
    • testFindAllDifferentSession

      @Test void testFindAllDifferentSession()
      Tests that the findAll method returns an empty list when searching for sources results in a different session.
    • testFindAllMaxCapacity

      @Test void testFindAllMaxCapacity()
      Tests that the findAll method returns the expected sources results when the maximum capacity is reached.
    • testFindAllBeyondCapacity

      @Test void testFindAllBeyondCapacity()
      Tests that the findAll method returns the expected sources results when the maximum capacity is exceeded.
    • testFindAllSourcesEmpty

      @Test void testFindAllSourcesEmpty()
      Tests that the findAllSources method returns an empty list when no sources are available.
    • testFindAllArticles

      @Test void testFindAllArticles() throws IOException
      Tests that the findAllSources method returns the expected sources when available.
      Throws:
      IOException - If an I/O error occurs
    • testFindAllArticlesDifferentSession

      @Test void testFindAllArticlesDifferentSession() throws IOException
      Tests that the findAllSources method returns an empty list when searching for sources in a different session.
      Throws:
      IOException - If an I/O error occurs
    • testSave

      @Test void testSave()
      Tests that the save method adds a sources result and returns the expected sources result.